 /****** object:  Table [dbo].[Classes]    Script Date: 09/27/2008 16:37:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Classes](
	[ClassID] [smallint] IDENTITY(1,1) NOT NULL,
	[Name] [varchar](20) NOT NULL,
	[ModifierInsight] [tinyint] NOT NULL,
	[ModifierIntellect] [tinyint] NOT NULL,
	[ModifierAccuracy] [tinyint] NOT NULL,
	[ModifierWill] [tinyint] NOT NULL,
	[ModifierForce] [tinyint] NOT NULL,
	[ModifierEnergy] [tinyint] NOT NULL,
	[ModifierStrength] [tinyint] NOT NULL,
	[ModifierEndurance] [tinyint] NOT NULL,
	[ModifierAgility] [tinyint] NOT NULL,
 CONSTRAINT [PK_Classes] PRIMARY KEY CLUSTERED 
(
	[ClassID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** object:  Table [dbo].[Races]    Script Date: 09/27/2008 16:38:30 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Races](
	[RaceID] [smallint] IDENTITY(1,1) NOT NULL,
	[Name] [varchar](20) NOT NULL,
	[ModifierInsight] [tinyint] NOT NULL,
	[ModifierIntellect] [tinyint] NOT NULL,
	[ModifierAccuracy] [tinyint] NOT NULL,
	[ModifierWill] [tinyint] NOT NULL,
	[ModifierForce] [tinyint] NOT NULL,
	[ModifierEnergy] [tinyint] NOT NULL,
	[ModifierStrength] [tinyint] NOT NULL,
	[ModifierEndurance] [tinyint] NOT NULL,
	[ModifierAgility] [tinyint] NOT NULL,
 CONSTRAINT [PK_Races] PRIMARY KEY CLUSTERED 
(
	[RaceID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** object:  Table [dbo].[Items]    Script Date: 09/27/2008 16:38:09 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Items](
	[ItemID] [int] NOT NULL,
	[Name] [varchar](20) NOT NULL,
 CONSTRAINT [PK_Items] PRIMARY KEY CLUSTERED 
(
	[ItemID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** object:  Table [dbo].[Guilds]    Script Date: 09/27/2008 16:38:03 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Guilds](
	[GuildID] [bigint] IDENTITY(1,1) NOT NULL,
	[Name] [varchar](25) NOT NULL,
	[BankValue] [bigint] NOT NULL CONSTRAINT [DF_Guilds_BankValue]  DEFAULT ((0)),
	[DateCreated] [datetime] NOT NULL,
 CONSTRAINT [PK_Guilds] PRIMARY KEY CLUSTERED 
(
	[GuildID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** object:  Table [dbo].[BankAccounts]    Script Date: 09/27/2008 16:36:20 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[BankAccounts](
	[BankAccountID] [bigint] IDENTITY(1,1) NOT NULL,
	[MonetaryValue] [bigint] NOT NULL CONSTRAINT [DF_BankAccounts_MonetaryValue]  DEFAULT ((0)),
	[VaultLevel] [tinyint] NOT NULL CONSTRAINT [DF_BankAccounts_VaultLevel]  DEFAULT ((0)),
 CONSTRAINT [PK_BankAccounts] PRIMARY KEY CLUSTERED 
(
	[BankAccountID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** object:  Table [dbo].[Accounts]    Script Date: 09/27/2008 16:36:11 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Accounts](
	[AccountID] [uniqueidentifier] ROWGUIDCOL  NOT NULL CONSTRAINT [DF_Accounts_AccountID]  DEFAULT (newid()),
	[AccountName] [varchar](50) NOT NULL,
	[Password] [varbinary](256) NOT NULL,
	[PasswordSalt] [varbinary](256) NOT NULL,
	[EmailAddress] [varchar](256) NOT NULL,
	[Locked] [bit] NOT NULL,
	[DateCreated] [datetime] NOT NULL,
	[DateLastLogin] [datetime] NULL,
	[DateLastLocked] [datetime] NULL,
	[Comment] [text] NULL,
 CONSTRAINT [PK_Accounts] PRIMARY KEY CLUSTERED 
(
	[AccountID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** object:  Table [dbo].[GuildMembers]    Script Date: 09/27/2008 16:37:39 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[GuildMembers](
	[MemberID] [bigint] IDENTITY(1,1) NOT NULL,
	[CharacterID] [uniqueidentifier] NOT NULL,
	[RankID] [bigint] NOT NULL,
	[GuildID] [bigint] NOT NULL,
	[DateJoined] [datetime] NOT NULL,
 CONSTRAINT [PK_GuildMembers] PRIMARY KEY CLUSTERED 
(
	[MemberID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** object:  Table [dbo].[CharacterClasses]    Script Date: 09/27/2008 16:36:27 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[CharacterClasses](
	[CharacterID] [uniqueidentifier] NOT NULL,
	[ClassID] [smallint] NOT NULL,
	[Ranks] [tinyint] NOT NULL,
 CONSTRAINT [PK_CharacterClasses] PRIMARY KEY CLUSTERED 
(
	[CharacterID] ASC,
	[ClassID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** object:  Table [dbo].[Characters]    Script Date: 09/27/2008 16:36:57 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Characters](
	[CharacterID] [uniqueidentifier] ROWGUIDCOL  NOT NULL CONSTRAINT [DF_Character_CharacterID]  DEFAULT (newid()),
	[AccountID] [uniqueidentifier] NOT NULL,
	[RaceID] [smallint] NOT NULL,
	[CharacterName] [varchar](20) NOT NULL,
	[Money] [bigint] NOT NULL,
	[BaseInsight] [tinyint] NOT NULL,
	[BaseIntellect] [tinyint] NOT NULL,
	[BaseAccuracy] [tinyint] NOT NULL,
	[BaseWill] [tinyint] NOT NULL,
	[BaseForce] [tinyint] NOT NULL,
	[BaseEnergy] [tinyint] NOT NULL,
	[BaseStrength] [tinyint] NOT NULL,
	[BaseEndurance] [tinyint] NOT NULL,
	[BaseAgility] [tinyint] NOT NULL,
 CONSTRAINT [PK_Character] PRIMARY KEY CLUSTERED 
(
	[CharacterID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** object:  Table [dbo].[EquipmentItems]    Script Date: 09/27/2008 16:37:27 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[EquipmentItems](
	[EquipmentItemID] [int] NOT NULL,
	[EquipmentPosition] [tinyint] NOT NULL,
 CONSTRAINT [PK_EquipmentItems] PRIMARY KEY CLUSTERED 
(
	[EquipmentItemID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_EquipmentItems] ON [dbo].[EquipmentItems] 
(
	[EquipmentItemID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
/****** object:  Table [dbo].[GuildRanks]    Script Date: 09/27/2008 16:37:52 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[GuildRanks](
	[RankID] [bigint] IDENTITY(1,1) NOT NULL,
	[GuildID] [bigint] NOT NULL,
	[Name] [varchar](20) NOT NULL,
	[IsLeader] [bit] NOT NULL CONSTRAINT [DF_GuildRanks_IsLeader]  DEFAULT ((0)),
 CONSTRAINT [PK_GuildRanks] PRIMARY KEY CLUSTERED 
(
	[RankID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** object:  ForeignKey [FK_CharacterClasses_Characters]    Script Date: 09/27/2008 16:36:28 ******/
ALTER TABLE [dbo].[CharacterClasses]  WITH CHECK ADD  CONSTRAINT [FK_CharacterClasses_Characters] FOREIGN KEY([CharacterID])
REFERENCES [dbo].[Characters] ([CharacterID])
GO
ALTER TABLE [dbo].[CharacterClasses] CHECK CONSTRAINT [FK_CharacterClasses_Characters]
GO
/****** object:  ForeignKey [FK_CharacterClasses_Classes]    Script Date: 09/27/2008 16:36:29 ******/
ALTER TABLE [dbo].[CharacterClasses]  WITH CHECK ADD  CONSTRAINT [FK_CharacterClasses_Classes] FOREIGN KEY([ClassID])
REFERENCES [dbo].[Classes] ([ClassID])
GO
ALTER TABLE [dbo].[CharacterClasses] CHECK CONSTRAINT [FK_CharacterClasses_Classes]
GO
/****** object:  ForeignKey [FK_Characters_Accounts]    Script Date: 09/27/2008 16:36:58 ******/
ALTER TABLE [dbo].[Characters]  WITH CHECK ADD  CONSTRAINT [FK_Characters_Accounts] FOREIGN KEY([AccountID])
REFERENCES [dbo].[Accounts] ([AccountID])
GO
ALTER TABLE [dbo].[Characters] CHECK CONSTRAINT [FK_Characters_Accounts]
GO
/****** object:  ForeignKey [FK_Characters_Races]    Script Date: 09/27/2008 16:36:59 ******/
ALTER TABLE [dbo].[Characters]  WITH CHECK ADD  CONSTRAINT [FK_Characters_Races] FOREIGN KEY([RaceID])
REFERENCES [dbo].[Races] ([RaceID])
GO
ALTER TABLE [dbo].[Characters] CHECK CONSTRAINT [FK_Characters_Races]
GO
/****** object:  ForeignKey [FK_EquipmentItems_Items]    Script Date: 09/27/2008 16:37:28 ******/
ALTER TABLE [dbo].[EquipmentItems]  WITH CHECK ADD  CONSTRAINT [FK_EquipmentItems_Items] FOREIGN KEY([EquipmentItemID])
REFERENCES [dbo].[Items] ([ItemID])
GO
ALTER TABLE [dbo].[EquipmentItems] CHECK CONSTRAINT [FK_EquipmentItems_Items]
GO
/****** object:  ForeignKey [FK_GuildMembers_Characters]    Script Date: 09/27/2008 16:37:41 ******/
ALTER TABLE [dbo].[GuildMembers]  WITH CHECK ADD  CONSTRAINT [FK_GuildMembers_Characters] FOREIGN KEY([CharacterID])
REFERENCES [dbo].[Characters] ([CharacterID])
GO
ALTER TABLE [dbo].[GuildMembers] CHECK CONSTRAINT [FK_GuildMembers_Characters]
GO
/****** object:  ForeignKey [FK_GuildMembers_GuildRanks]    Script Date: 09/27/2008 16:37:42 ******/
ALTER TABLE [dbo].[GuildMembers]  WITH CHECK ADD  CONSTRAINT [FK_GuildMembers_GuildRanks] FOREIGN KEY([RankID])
REFERENCES [dbo].[GuildRanks] ([RankID])
GO
ALTER TABLE [dbo].[GuildMembers] CHECK CONSTRAINT [FK_GuildMembers_GuildRanks]
GO
/****** object:  ForeignKey [FK_GuildMembers_Guilds]    Script Date: 09/27/2008 16:37:43 ******/
ALTER TABLE [dbo].[GuildMembers]  WITH CHECK ADD  CONSTRAINT [FK_GuildMembers_Guilds] FOREIGN KEY([GuildID])
REFERENCES [dbo].[Guilds] ([GuildID])
GO
ALTER TABLE [dbo].[GuildMembers] CHECK CONSTRAINT [FK_GuildMembers_Guilds]
GO
/****** object:  ForeignKey [FK_GuildRanks_Guilds]    Script Date: 09/27/2008 16:37:53 ******/
ALTER TABLE [dbo].[GuildRanks]  WITH CHECK ADD  CONSTRAINT [FK_GuildRanks_Guilds] FOREIGN KEY([GuildID])
REFERENCES [dbo].[Guilds] ([GuildID])
GO
ALTER TABLE [dbo].[GuildRanks] CHECK CONSTRAINT [FK_GuildRanks_Guilds]
GO
